<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>
    <script type="text/javascript">
    	
   		document.addEventListener('plusready', function(){
   			//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"
   			
   		});
   		
    </script>
    <style type="text/css">
    		body {
    			height: 100%;
    			width: 100%;
    		}
    		
    </style>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/buttons.css"/>
</head>
<body>
	<div class="container-fluid">
		<div class="col-md-12" style="text-align: center;">
			<br />
			<br />
			<br />
			  <a class="button button-block button-rounded button-action button-large" id="openDoor">开门</a>
			  <br />
			  <a class="button button-block button-rounded button-primary button-large" id="closeDoor">关门</a>
			  <br />
			  <!--<a class="button button-block button-rounded button-highlight button-large" ></a>-->
			  <a class="button button-block button-rounded button-highlight button-large"id="autoCloseDoor">开门5秒</a>
			  <br />
			  <br />
			  <br />
			  <p id="msgStatus">信息状态栏</p>
		</div>
	</div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.min.js" type="text/javascript"></script>
<script src="js/mqtt.js"></script>
<script type="text/javascript">
//	$().ready(function(){
//		connectServer(mqttServer_url, mqttServer_port, clientID, "lexinsmart/1361687");
//	});
	$('#openDoor').on('click', function (){
		sendMsg(topic, '{"Switch":1}', "开门");
	});
	$('#closeDoor').on('click', function (){
		sendMsg(topic, '{"Switch":2}', "关门");
	});
	$('#autoCloseDoor').on('click', function (){
		sendMsg(topic, '{"Switch":3}', "延时关门");
	});
</script>
</html>